//pthread_self函数
#include <my_head.h>
void *task_func(void *arg){
    printf("我是子线程  线程id [%ld]\n",pthread_self());
    sleep(100);
}

int main(int argc, char const *argv[])
{
    pthread_t tid = 0;
    int ret = 0;
    if(0 != (ret = pthread_create(&tid,NULL,task_func,NULL))){
        printf("pthread_create error : [%d] [%s]\n",ret,strerror(ret));
        exit(EXIT_FAILURE);
    }
    printf("我是主线程 线程id [%ld]\n",pthread_self());
    printf("我是主线程 子线程id [%ld]\n",tid);
    sleep(100);
    return 0;
}
